package com.yh.threadTest.pojo;

import com.yh.chapter2.test.Test;

/**
 * @ClassName TestYield
 * @Description TODO
 * @Author 0715-YuHao
 * @Date 2020/11/14 13:03
 */
public class TestYield implements Runnable {

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + "开始执行");
        Thread.yield();
        System.out.println(Thread.currentThread().getName() + "执行完毕");
    }

    public static void main(String[] args) {
        Runnable r = new TestYield();
        new Thread(r, "a").start();
        new Thread(r, "b").start();
    }
}
